import { CardEditableParamsDefault } from "@/views/card/js/data/cardDatas/index.js";



/** CardSiteDataEditableParamsDefaultLists4ListAdd
 * [CardSiteDataEditableParamsDefaultLists4ListAdd description]
 * @type {Object}
 */
export const CardSiteDataEditableParamsDefaultLists4ListAdd = {
  PAGE_INFO: {
    toolbar_menus: [
      {
        "type": "link",
        "name": "",
        "pic": "",
        "pic_default": "",
        "params": {
          "scheme": "",
        },
      },
    ],
    cardlist_head_cards: [
      {
        "head_type": '0',  // 0: channel list 1: 沉浸式头部
        "head_type_name": "channel_list",  // header名字，无实际用途
        "menu_scheme": "",  // 右边下拉箭头scheme
        "show_menu": false,  // 是否显示最右边的下拉箭头
        "channel_list": [],  // 频道列表
      },
      {
        "head_type": '1',  // 0: channel list 1: 沉浸式头部
        "head_type_name": "immersive",  // header名字，无实际用途
        "show_menu": false,  // 是否显示最右边的下拉箭头
        "menu_scheme": "",  // 右边下拉箭头scheme
        "title_top": "沉浸式",
        "head_data": {  // 目前head_data只能支持有限几种样式
            "cover_url": "",  // https:\/\/h5.sinaimg.cn\/upload\/2016\/01\/21\/13\/page_top_background_blue.png
            "data_type": 4,
            "data_type_name": "immersive data type",
            "scheme": "",
            "left_title": "",  // 博文头条
            "left_desc": "",  // 预计购买后阅读数增长
            "left_num": "",  // 2.1
            "left_unit": "",  // 倍
            "left_scheme": "",
            "right_title": "",
            "right_desc": "",  // 预计购买后阅读数为
            "right_num": "",  // 136
            "right_unit": "",
            "right_scheme": ""
        },
      },
    ],
    channel_list: [
      {
        "id": "",  // 231093_-_selfrecomm
        "name": "",  // 推荐
        "containerid": "",  // 231093_-_selfrecomm
        "scheme": "",
        "must_show": '1',
        "default_add": '1',
      },
    ],
  },
};



/** CardSiteDataEditableParamsLists
 * [CardSiteDataEditableParamsLists description]
 * @type {Object}
 */
export const CardSiteDataEditableParamsLists = {
  PAGE_INFO: {
    cardlist_head_cards: {
      ..._.cloneDeep(CardEditableParamsDefault.Lists),
      label: 'Card页头部',
      limit: 1,
      param_params: {
        head_type: {
          ..._.cloneDeep(CardEditableParamsDefault.DropdownNormal),
          label: '样式',
          placeholder: '请选择',
          valLists: [
            {
              name: 'channel list',  // default
              value: '0',
            },
            // {
            //   name: '沉浸式头部',
            //   value: '1',
            // },
          ],
        },
        head_type_name: {  // header名字，无实际用途
          ..._.cloneDeep(CardEditableParamsDefault.InputNormal),
          label: 'header名字',
          placeholder: 'header名字',
          disabled: true,

          param_effect_parent: {
            effect_parent_keys: ['cardlist_head_cards', 'ARRAY_NUM', 'head_type'],
            effect_type: ['CHANGE_PARAMS'],
            effect_obj_params: [
              {
                effect_regular: new RegExp("^[0]$"),
                effect_new_obj_params: 'channel_list',
              },
              {
                effect_regular: new RegExp("^[1]$"),
                effect_new_obj_params: 'immersive',
              },
            ],
          },
        },

        // 沉浸式头部
        // title_top: {},
        head_data: {
          ..._.cloneDeep(CardEditableParamsDefault.Obj),
          label: '沉浸式数据配置',
          param_params: {
            cover_url: {
              ..._.cloneDeep(CardEditableParamsDefault.ImageNormal),
              label: '头部背景图',
              res_type: 'String',  // Array : fileList, String : value
              placeholder: '尺寸严格按照设置的宽高，小于500kb，png格式',
              limit: 1,
              size: 500,
              accept: '.png',
            }
          },

          param_effect_parent: {
            effect_parent_keys: ['cardlist_head_cards', 'ARRAY_NUM', 'head_type'],
            effect_type: ['CHANGE_PARAMS'],
            effect_obj_params: [
              {
                effect_regular: new RegExp("^[0]$"),
                effect_new_obj_params: {},
              },
              {
                effect_regular: new RegExp("^[1]$"),
                effect_new_obj_params: {
                  ..._.cloneDeep(CardSiteDataEditableParamsDefaultLists4ListAdd.PAGE_INFO.cardlist_head_cards[1].head_data),
                },
              },
            ],
          },
        },

        // channel list
        channel_list: {
          ..._.cloneDeep(CardEditableParamsDefault.Lists),
          label: 'channel list tab',
          param_params: {
            containerid: {
              ..._.cloneDeep(CardEditableParamsDefault.InputNormal),
              label: '链接 containerid',
              placeholder: '请输入 containerid',
            },
            id: {
              ..._.cloneDeep(CardEditableParamsDefault.InputNormal),
              label: 'ID',
              placeholder: 'id',
              disabled: true,

              param_effect_parent: {
                effect_parent_keys: ['cardlist_head_cards', 'ARRAY_NUM', 'channel_list', 'ARRAY_NUM', 'containerid'],
                effect_type: ['COPY'],
                effect_parent_val: '',
                effect_clear: {  // 受 SHOW_HIDE 影响
                  effect_clear_default_val: '',  // default
                },
                // effect_copy: {},
              },
            },
            name: {
              ..._.cloneDeep(CardEditableParamsDefault.InputNormal),
              label: 'tab名称',
              placeholder: '请输入名称',
            },
            // must_show: {
            //   ..._.cloneDeep(CardEditableParamsDefault.SwitchNormal),
            //   label: '首先展示',
            //   bIsUpdateManual: true,
            //   boolReplace: {
            //     boolTrue: '1',
            //     boolFalse: '0',
            //   },
            // },
            default_add: {
              ..._.cloneDeep(CardEditableParamsDefault.SwitchNormal),
              label: '显示(是|否)',
              bIsUpdateManual: true,
              boolReplace: {
                boolTrue: '1',
                boolFalse: '0',
              },
            },
          },

          param_effect_parent: {
            effect_parent_keys: ['cardlist_head_cards', 'ARRAY_NUM', 'head_type'],
            effect_type: ['SHOW_HIDE'],
            effect_parent_val: '0',
            effect_clear: {
              effect_clear_default_val: null,
            },
          },
        },
      },
    },
    toolbar_menus: {
      ..._.cloneDeep(CardEditableParamsDefault.Lists),
      label: '底导列表',
      param_params: {
        name: {
          ..._.cloneDeep(CardEditableParamsDefault.InputNormal),
          label: '卡片名称',
          placeholder: '请输入卡片名称',
        },
        pic: {
          ..._.cloneDeep(CardEditableParamsDefault.ImageNormal),
          label: '图标',
          res_type: 'String',  // Array : fileList, String : value
          placeholder: '尺寸严格按照设置的宽高，小于100kb，png格式',
          limit: 1,
          size: 100,
          accept: '.png',
        },
        pic_default: {
          ..._.cloneDeep(CardEditableParamsDefault.ImageNormal),
          label: '图标(同上)',
          res_type: 'String',  // Array : fileList, String : value
          placeholder: '尺寸严格按照设置的宽高，小于100kb，png格式',
          limit: 1,
          size: 100,
          accept: '.png',
          suffix: '_default',
        },
        type: {
          ..._.cloneDeep(CardEditableParamsDefault.DropdownNormal),
          label: '底导类型',
          placeholder: '请选择',
          valLists: [
            // {
            //   name: '默认',  // default
            //   value: 'default',
            // },
            {
              name: '链接',
              value: 'link',
            },
          ],
        },
        params: {
          ..._.cloneDeep(CardEditableParamsDefault.Obj),
          label: '其他参数',
          param_params: {
            scheme: {
              ..._.cloneDeep(CardEditableParamsDefault.InputNormal),
              label: '跳转链接',
              placeholder: '请输入跳转链接',
            },
            action: {
              ..._.cloneDeep(CardEditableParamsDefault.Action),
              label: '事件',
              placeholder: '请选择事件',
            },
          },

          param_effect_parent: {
            effect_parent_keys: ['toolbar_menus', 'ARRAY_NUM', 'type'],
            effect_type: ['CHANGE_PARAMS'],
            effect_obj_params: [
              {
                effect_regular: new RegExp("^link$"),
                effect_new_obj_params: {
                  scheme: '',
                },
              },
              {
                effect_regular: new RegExp("^default$"),
                effect_new_obj_params: {
                  action: '',
                },
              },
            ],
          },
        },
      },
    },
  },
};
